package Controller.Member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;

import Bean.MemberBean;
import Dao.MemberDao;

public class MemberSearchID extends AbstractCommandController{
	private MemberDao member;
	
	public void setMember(MemberDao member) {
		this.member = member;
	}

	@Override
	protected ModelAndView handle(HttpServletRequest req,
			HttpServletResponse res, Object obj, BindException arg3)
			throws Exception {
		MemberBean bean = (MemberBean)obj;
		System.out.println(bean.getM_ssn1());
		System.out.println(bean.getM_ssn2());
		bean = member.mSearchID(bean);
		System.out.println("sql 확인: "+bean.getM_id());
		ModelAndView mav = new ModelAndView();
		String comment = "alert('아이디 :"+bean.getM_id()+"')";
		return new ModelAndView("Search", "comment", comment);
	}
}
